home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / b.dxr / 00005_Environment B Specific scripts.ls next >
Encoding:
Text File  |  1996-02-15  |  22.8 KB  |  723 lines

  1. global gStates, gObjects, gCursorlist, gKeyRef, gUNVobjects, sBGpict, gTimerList, gSoundchannels, gCurKeyRef, sQTSPRITE
  2.  
  3. on EnterB02
  4.   if getaProp(getaProp(gStates, #Conditions), #Trailer) = #true then
  5.     PDARelease("J04m01p.mov")
  6.     PDARelease("J05weath.mov")
  7.   end if
  8. end
  9.  
  10. on EnterB09
  11.   if (getaProp(getaProp(gStates, #BeenThere), #B19A) + getaProp(getaProp(gStates, #BeenThere), #B19B)) > 1 then
  12.     PDARelease("J04m10c.mov")
  13.   end if
  14. end
  15.  
  16. on doGetLeaf2
  17.   ReleaseUNVobject(#leaf1Obj)
  18.   genexitkf(#B16B)
  19. end
  20.  
  21. on enterB21
  22.   set OBj to getaProp(gObjects, #ButterFlySeen)
  23.   if (getaProp(getaProp(gStates, #Conditions), #Trailer) = #true) and (getaProp(OBj, #State) = #Trailer) then
  24.     MakeDynamic(#ButterFlySeen, #State, #Butter)
  25.     Startthetimer(1, "StartMillSounds")
  26.   else
  27.     if getaProp(OBj, #State) = #seen then
  28.       playSound("B21mill.aif", #keyframeCast)
  29.     else
  30.       if getaProp(getaProp(gStates, #Conditions), #Trailer) <> #true then
  31.         playSound("B21wind.aif", #keyframeCast)
  32.       end if
  33.     end if
  34.   end if
  35. end
  36.  
  37. on StartMillSounds
  38.   playSound("B21wind.aif", #keyframeCast)
  39.   set animObj to getaProp(getaProp(gObjects, #ButterAnim), #animator)
  40.   repeat while the pCurrentFrame of animObj < 30
  41.     CursorandUpdate()
  42.   end repeat
  43.   stopsound("B21wind.aif")
  44.   set startSoundChannel to playSound("B21start.aif", #keyframeCast)
  45.   repeat while soundBusy(startSoundChannel)
  46.     CursorandUpdate()
  47.   end repeat
  48.   stopsound("B21start.aif")
  49.   playSound("B21mill.aif", #keyframeCast)
  50. end
  51.  
  52. on DoBdoortoC
  53.   set OBj to getaProp(gObjects, #ButterFlySeen)
  54.   if (getaProp(getaProp(gStates, #Conditions), #Trailer) = #true) and (getaProp(OBj, #State) = #seen) then
  55.     genexitkf(#C01)
  56.   else
  57.     playSound("B31FXno.aif", #keyframeCast)
  58.   end if
  59. end
  60.  
  61. on DoSail
  62.   if gKeyRef = #B10A then
  63.     PDARelease("J04m05c.mov")
  64.   else
  65.     if gKeyRef = #B10B then
  66.       PDARelease("J04m16p.mov")
  67.     end if
  68.   end if
  69.   genexitkf(#B10B)
  70.   setaProp(gStates, #redHerring, 1)
  71. end
  72.  
  73. on ExitB16A
  74.   if getaProp(getaProp(gObjects, #BBGasSwitch), #State) = #open then
  75.     do(string(getaProp(getaProp(getaProp(gObjects, #BBGasSwitch), #Action), #down) && "#BBGasSwitch"))
  76.   end if
  77.   if getaProp(getaProp(gObjects, #BBvalve), #State) = #open then
  78.     do(string(getaProp(getaProp(getaProp(gObjects, #BBvalve), #Action), #down) && "#BBvalve"))
  79.   end if
  80. end
  81.  
  82. on setupBalloon
  83.   givePDA()
  84.   set the State of the ButterFlySeen of gObjects to #seen
  85.   Jumptokey(#b16a)
  86. end
  87.  
  88. on DoHoseAttach
  89.   set HOBJ to getaProp(gObjects, #BBHose)
  90.   set VOBJ to getaProp(gObjects, #BBvalve)
  91.   set FOBJ to getaProp(gObjects, #BBGasSwitch)
  92.   set GOBJ to getaProp(gObjects, #BBgage)
  93.   if getaProp(HOBJ, #State) = #open then
  94.     MakeDynamic(#BBHose, #Hotrect, getaProp(getaProp(gObjects, #BBHose), #AttachHOTRECT))
  95.     MakeDynamic(#BBHose, #DisplayState, #Attach)
  96.     set SpriteNum to getaProp(HOBJ, #SpriteNum)
  97.     deleteProp(gHotRects, value(string(SpriteNum) & "01"))
  98.     deleteProp(gHotRects, value(string(SpriteNum) & "02"))
  99.     if getaProp(VOBJ, #State) = #open then
  100.       playSound("B16FXhs.aif", #keyframeCast)
  101.     end if
  102.     setHoseHotRects()
  103.     if (getaProp(VOBJ, #State) = #open) and (getaProp(FOBJ, #State) = #open) and (getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen) then
  104.       BallonFillTank()
  105.     end if
  106.   else
  107.     if getaProp(HOBJ, #State) = #close then
  108.       MakeDynamic(#BBHose, #Hotrect, getaProp(getaProp(gObjects, #BBHose), #DetachHOTRECT))
  109.       MakeDynamic(#BBHose, #DisplayState, #Detach)
  110.       set SpriteNum to getaProp(HOBJ, #SpriteNum)
  111.       deleteProp(gHotRects, value(string(SpriteNum) & "01"))
  112.       deleteProp(gHotRects, value(string(SpriteNum) & "02"))
  113.       setHoseHotRects()
  114.       if getaProp(VOBJ, #State) = #open then
  115.         playSound("B16FXhs.aif", #keyframeCast)
  116.       end if
  117.       BallonTurnOffGas()
  118.       if getaProp(getaProp(gObjects, #BBGasSwitch), #State) = #open then
  119.         DrainTank()
  120.       end if
  121.     end if
  122.   end if
  123. end
  124.  
  125. on setHoseHotRects
  126.   set HoseOBJ to getaProp(gObjects, #BBHose)
  127.   set nRects to count(getaProp(HoseOBJ, #Hotrect))
  128.   repeat with X = 1 to nRects
  129.     set hotrectlist to [#rect: getAt(getaProp(HoseOBJ, #Hotrect), X), #RefName: getaProp(HoseOBJ, #RefName)]
  130.     setaProp(gHotRects, value(getaProp(HoseOBJ, #SpriteNum) & 0 & X), hotrectlist)
  131.   end repeat
  132. end
  133.  
  134. on DoBBvalve
  135.   set HOBJ to getaProp(gObjects, #BBHose)
  136.   set VOBJ to getaProp(gObjects, #BBvalve)
  137.   set FOBJ to getaProp(gObjects, #BBGasSwitch)
  138.   set GOBJ to getaProp(gObjects, #BBgage)
  139.   if getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen then
  140.     if getaProp(VOBJ, #State) = #open then
  141.       playSound("B16fxfil.aif", #keyframeCast)
  142.       if (getaProp(HOBJ, #State) = #open) and (getaProp(FOBJ, #State) = #open) then
  143.         BallonFillTank()
  144.       end if
  145.     else
  146.       if getaProp(VOBJ, #State) = #close then
  147.         stopsound("B16fxfil.aif")
  148.         BallonTurnOffGas()
  149.       end if
  150.     end if
  151.   end if
  152. end
  153.  
  154. on DoBBGasSwitch
  155.   set HOBJ to getaProp(gObjects, #BBHose)
  156.   set VOBJ to getaProp(gObjects, #BBvalve)
  157.   set FOBJ to getaProp(gObjects, #BBGasSwitch)
  158.   set GOBJ to getaProp(gObjects, #BBgage)
  159.   if (getaProp(FOBJ, #State) = #open) and (getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen) then
  160.     playSound("B16fxvlv.aif", #keyframeCast)
  161.   else
  162.     stopsound("B16fxvlv.aif")
  163.   end if
  164.   if (getaProp(FOBJ, #State) = #open) and (getaProp(HOBJ, #State) = #open) and (getaProp(VOBJ, #State) = #open) and (getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen) then
  165.     BallonFillTank()
  166.   else
  167.     if (getaProp(FOBJ, #State) = #open) and (getaProp(HOBJ, #State) = #close) then
  168.       BallonTurnOffGas()
  169.       DrainTank()
  170.     else
  171.       if getaProp(FOBJ, #State) = #close then
  172.         BallonTurnOffGas()
  173.       end if
  174.     end if
  175.   end if
  176. end
  177.  
  178. on BallonFillTank
  179.   playSound("B16FXhss.aif", #keyframeCast)
  180.   MakeDynamic(#BBgage, #State, #on)
  181.   Startthetimer(30, "MoveBallonGage", #BBvalve)
  182. end
  183.  
  184. on BallonTurnOffGas
  185.   set HOBJ to getaProp(gObjects, #BBHose)
  186.   set VOBJ to getaProp(gObjects, #BBvalve)
  187.   set GOBJ to getaProp(gObjects, #BBgage)
  188.   MakeDynamic(#BBgage, #State, #off)
  189.   if not voidp(getaProp(VOBJ, #timer)) then
  190.     set howmany to count(getaProp(VOBJ, #timer))
  191.     repeat with thisTimer = 1 to howmany
  192.       set killtimer to getAt(getaProp(VOBJ, #timer), 1)
  193.       DeletetheTimer(killtimer)
  194.     end repeat
  195.   end if
  196. end
  197.  
  198. on MoveBallonGage
  199.   set BOBJ to getaProp(gObjects, #BBallon)
  200.   set GOBJ to getaProp(gObjects, #BBgage)
  201.   if getaProp(GOBJ, #State) = #off then
  202.     exit
  203.   end if
  204.   if getaProp(GOBJ, #DisplayState) = #FULL then
  205.     if getaProp(BOBJ, #Explode) = #false then
  206.       setaProp(BOBJ, #explodeTimer, the ticks)
  207.     end if
  208.     MakeDynamic(#BBallon, #Explode, #Pending)
  209.     if the ticks > (getaProp(BOBJ, #explodeTimer) + 300) then
  210.       BallonBlowUp()
  211.     end if
  212.     if (getaProp(BOBJ, #Launch) = #false) and (getaProp(BOBJ, #Explode) <> #true) then
  213.       Startthetimer(30, "MoveBallonGage", #BBvalve)
  214.     end if
  215.   else
  216.     if getaProp(GOBJ, #DisplayState) = 20 then
  217.       playSound("B16wng.aif", #keyframeCast)
  218.       MakeDynamic(#BBgage, #DisplayState, #FULL)
  219.       Startthetimer(30, "MoveBallonGage", #BBvalve)
  220.       set the castNum of sprite getaProp(GOBJ, #SpriteNum) to getaProp(getaProp(GOBJ, #cast), #FULL)
  221.     else
  222.       MakeDynamic(#BBgage, #DisplayState, getaProp(GOBJ, #DisplayState) + 1)
  223.       Startthetimer(30, "MoveBallonGage", #BBvalve)
  224.       set the castNum of sprite getaProp(GOBJ, #SpriteNum) to getaProp(getaProp(GOBJ, #cast), getaProp(GOBJ, #DisplayState))
  225.     end if
  226.   end if
  227. end
  228.  
  229. on DrainTank
  230.   set GOBJ to getaProp(gObjects, #BBgage)
  231.   playSound("B16fxvlv.aif", #keyframeCast)
  232.   if getaProp(GOBJ, #DisplayState) = #FULL then
  233.     MakeDynamic(#BBgage, #DisplayState, 20)
  234.     set the castNum of sprite getaProp(GOBJ, #SpriteNum) to getaProp(getaProp(GOBJ, #cast), 20)
  235.     CursorandUpdate()
  236.   end if
  237.   repeat while getaProp(GOBJ, #DisplayState) <> 1
  238.     MakeDynamic(#BBgage, #DisplayState, getaProp(GOBJ, #DisplayState) - 1)
  239.     set the castNum of sprite getaProp(GOBJ, #SpriteNum) to getaProp(getaProp(GOBJ, #cast), getaProp(GOBJ, #DisplayState))
  240.     CursorandUpdate()
  241.   end repeat
  242.   stopsound("B16fxvlv.aif")
  243. end
  244.  
  245. on BallonFillGasAir
  246.   Startthetimer(the maxinteger / 2, "Nothing", #BBvalve)
  247. end
  248.  
  249. on BallonBlowUp
  250.   set BOBJ to getaProp(gObjects, #BBallon)
  251.   MakeDynamic(#BBallon, #Explode, #true)
  252.   set explosionChannel to playSound("B16expl.aif", #keyframeCast)
  253.   DelObjects([#BallonControls])
  254.   set the castNum of sprite 1 to the number of cast "cNullSprite"
  255.   stopsound("B16fxfil.aif")
  256.   repeat while soundBusy(explosionChannel)
  257.     CursorandUpdate()
  258.   end repeat
  259.   genexitkf(#BDIE)
  260. end
  261.  
  262. on DoBBFlint
  263.   set BOBJ to getaProp(gObjects, #BBallon)
  264.   set HOBJ to getaProp(gObjects, #BBHose)
  265.   set VOBJ to getaProp(gObjects, #BBvalve)
  266.   set FOBJ to getaProp(gObjects, #BBGasSwitch)
  267.   set GOBJ to getaProp(gObjects, #BBgage)
  268.   if (getaProp(GOBJ, #DisplayState) >= 19) or ((getaProp(GOBJ, #DisplayState) = #FULL) and (getaProp(FOBJ, #State) = #open) and (getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen)) then
  269.     MakeDynamic(#bbflint, #Hotrect, [rect(0, 0, 0, 0)])
  270.     set gasSoundChannel to playSound("B16FXgas.aif", #keyframeCast)
  271.     Startthetimer(90, "LightFlame")
  272.     if getaProp(BOBJ, #Explode) <> #true then
  273.       Startthetimer(160, "BBLaunchBallon", #BBallon)
  274.       MakeDynamic(#BBallon, #Launch, #true)
  275.     end if
  276.   else
  277.     playSound("B16sprk2.aif", #keyframeCast)
  278.   end if
  279. end
  280.  
  281. on LightFlame
  282.   ChangeSpecialState(#bbflint, #Flame)
  283. end
  284.  
  285. on BBLaunchBallon
  286.   set HOBJ to getaProp(gObjects, #BBHose)
  287.   if getaProp(HOBJ, #State) = #open then
  288.     OpenClose(#BBHose)
  289.   end if
  290.   MakeDynamic(#BBallon, #solved, #true)
  291.   genexitkf(#B13B)
  292. end
  293.  
  294. on exitB31B
  295.   doResetPINScreen(#enterWndSpd)
  296. end
  297.  
  298. on EnterB31AD
  299.   set RegObj to getaProp(gObjects, #WaterRegulator)
  300.   set BridgeObj to getaProp(gObjects, #ChaoticBridge)
  301.   set BridgeAnimProps to getaProp(BridgeObj, #AnimProps)
  302.   if getaProp(RegObj, #State) <> #StationaryOpen then
  303.     MakeDynamic(#ChaoticBridgeParent, #State, #Chaotic)
  304.     if getaProp(RegObj, #State) = #RightLOW then
  305.       setaProp(BridgeAnimProps, #frameRate, 3)
  306.     else
  307.       setaProp(BridgeAnimProps, #frameRate, 10)
  308.     end if
  309.     MakeDynamic(#ChaoticBridge, #AnimProps, BridgeAnimProps)
  310.   else
  311.     MakeDynamic(#ChaoticBridgeParent, #State, #StationaryOpen)
  312.   end if
  313. end
  314.  
  315. on DoLaunchBT
  316.   set BOBJ to getProp(gObjects, #BBallon)
  317.   set panelObj to getaProp(gObjects, #LaunchPanel)
  318.   set currentPIN to getaProp(panelObj, #BRocketText)
  319.   if getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen then
  320.     if (getaProp(BOBJ, #solved) = #true) and (currentPIN = 10) then
  321.       switchFeedback(#relayingData)
  322.       MakeDynamic(#BRocket, #solved, #true)
  323.       genexitkf(#B31C)
  324.       Startthetimer(300, "SetUpRocketPDARelease")
  325.     else
  326.       if (getaProp(BOBJ, #solved) = #true) and (currentPIN <> 10) then
  327.         playSound("B31FXno.aif", #keyframeCast)
  328.         setRcktPINKeyState(#off)
  329.         switchFeedback(#incorrectWndSpd)
  330.         Startthetimer(120, "doResetPINScreen #incorrectWndSpd")
  331.         PDARelease("J04m07c.mov")
  332.       else
  333.         if getaProp(BOBJ, #solved) = #false then
  334.           playSound("B31bnt.aif", #keyframeCast)
  335.           setRcktPINKeyState(#off)
  336.           switchFeedback(#probeNotTrcked)
  337.           Startthetimer(120, "doResetPINScreen #probeNotTrcked")
  338.           PDARelease("J04m07c.mov")
  339.         end if
  340.       end if
  341.     end if
  342.   end if
  343. end
  344.  
  345. on SetUpRocketPDARelease
  346.   Startthetimer(the stopTime of sprite sQTSPRITE - the movieTime of sprite sQTSPRITE + 30, "doRocketPDARelease")
  347. end
  348.  
  349. on doRocketPDARelease
  350.   PDARelease("J04m04p.mov")
  351. end
  352.  
  353. on LaunchPad KeyNum
  354.   if getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen then
  355.     set LOBJ to getProp(gObjects, #LaunchBT)
  356.     set panelObj to getaProp(gObjects, #LaunchPanel)
  357.     set currentPIN to getaProp(panelObj, #BRocketText)
  358.     if integerp(KeyNum) then
  359.       if getaProp(panelObj, #State) = #on then
  360.         put string(KeyNum) after currentPIN
  361.         set curPosition to the number of chars in currentPIN
  362.         if curPosition = 3 then
  363.           setRcktPINKeyState(#off)
  364.         end if
  365.         set PINDispObj to getaProp(gObjects, value("#rcktPINDisp" & curPosition))
  366.         set PINDispSprtNum to getaProp(PINDispObj, #SpriteNum)
  367.         set wchCst to value("#PD" & KeyNum)
  368.         set the castNum of sprite PINDispSprtNum to getAt(getaProp(getaProp(PINDispObj, #cast), wchCst), 1)
  369.         MakeDynamic(getaProp(PINDispObj, #RefName), #DisplayState, wchCst)
  370.       end if
  371.     else
  372.       if KeyNum = #Cancel then
  373.         if currentPIN <> EMPTY then
  374.           setRcktPINKeyState(#on)
  375.           set curPosition to the number of chars in currentPIN
  376.           delete char -30000 of currentPIN
  377.           set PINDispObj to getaProp(gObjects, value("#rcktPINDisp" & curPosition))
  378.           set PINDispSprtNum to getaProp(PINDispObj, #SpriteNum)
  379.           set the castNum of sprite PINDispSprtNum to getAt(getaProp(getaProp(PINDispObj, #cast), #blank), 1)
  380.         end if
  381.       end if
  382.     end if
  383.     MakeDynamic(#LaunchPanel, #BRocketText, currentPIN)
  384.   end if
  385. end
  386.  
  387. on setRcktPINKeyState setState
  388.   if symbolp(setState) then
  389.     MakeDynamic(#LaunchPanel, #State, setState)
  390.   else
  391.     alert("bad parameter passed to setShortKeyBoardState")
  392.   end if
  393. end
  394.  
  395. on doResetPINScreen whichState
  396.   if getaProp(getaProp(gObjects, #ButterFlySeen), #State) = #seen then
  397.     repeat with X = 1 to 3
  398.       set PINDispObj to getaProp(gObjects, value("#rcktPINDisp" & X))
  399.       set PDSprtNum to getaProp(PINDispObj, #SpriteNum)
  400.       set the castNum of sprite PDSprtNum to getAt(getaProp(getaProp(PINDispObj, #cast), #blank), 1)
  401.       setaProp(PINDispObj, #DisplayState, #blank)
  402.     end repeat
  403.     setRcktPINKeyState(#on)
  404.     MakeDynamic(#LaunchPanel, #BRocketText, EMPTY)
  405.     switchFeedback(whichState)
  406.   end if
  407. end
  408.  
  409. on switchFeedback newState
  410.   set displayObj to getaProp(gObjects, #rcktScreenInfo)
  411.   MakeDynamic(#rcktScreenInfo, #DisplayState, newState)
  412.   MakeDynamic(#rcktScreenInfo, #State, newState)
  413.   set displaySprtNum to getaProp(displayObj, #SpriteNum)
  414.   set the castNum of sprite displaySprtNum to the number of cast getaProp(getaProp(displayObj, #cast), newState)
  415. end
  416.  
  417. on EnterB28
  418.   set RegObjState to getaProp(getaProp(gObjects, #WaterRegulator), #State)
  419.   if (RegObjState = #StationaryClose) or (RegObjState = #RightLOW) then
  420.     playSound("B28FXtrl.aif", #keyframeCast)
  421.   else
  422.     if (RegObjState = #LeftHi) or (RegObjState = #RightHi) then
  423.       playSound("B28FXgh1.aif", #keyframeCast)
  424.     end if
  425.   end if
  426. end
  427.  
  428. on DoBridgeValve
  429.   set VOBJ to getaProp(gObjects, #BridgeValve)
  430.   set BOBJ to getaProp(gObjects, #BridgeLeveler)
  431.   DoDisplayWaterFlow()
  432.   MakeDynamic(#BridgeValve, #DisplayState, getaProp(VOBJ, #State))
  433. end
  434.  
  435. on DoBridgeLeveler
  436.   set VOBJ to getaProp(gObjects, #BridgeValve)
  437.   set BOBJ to getaProp(gObjects, #BridgeLeveler)
  438.   set Child to getaProp(gObjects, #WaterONOFF)
  439.   set the castNum of sprite getaProp(Child, #SpriteNum) to getaProp(getaProp(Child, #cast), getaProp(BOBJ, #State))
  440.   DoDisplayWaterFlow()
  441.   MakeDynamic(#WaterONOFF, #DisplayState, getaProp(BOBJ, #State))
  442.   MakeDynamic(#BridgeLeveler, #DisplayState, getaProp(BOBJ, #State))
  443.   MakeDynamic(#BridgeValve, #DisplayState, getaProp(VOBJ, #State))
  444. end
  445.  
  446. on playWaterSound inSound
  447.   if inSound <> 0 then
  448.     if inSound = "B28FXtrl.aif" then
  449.       stopsound("B28FXgh1.aif")
  450.       playSound("B28FXtrl.aif", #keyframeCast)
  451.     else
  452.       if inSound = "B28FXgh1.aif" then
  453.         stopsound("B28FXtrl.aif")
  454.         playSound("B28FXgh1.aif", #keyframeCast)
  455.       end if
  456.     end if
  457.   else
  458.     if inSound = 0 then
  459.       stopsound("B28FXtrl.aif")
  460.       stopsound("B28FXgh1.aif")
  461.     end if
  462.   end if
  463. end
  464.  
  465. on DoDisplayWaterFlow
  466.   set VOBJ to getaProp(gObjects, #BridgeValve)
  467.   set BOBJ to getaProp(gObjects, #BridgeLeveler)
  468.   set RegObj to getaProp(gObjects, #WaterRegulator)
  469.   set aState to getaProp(getaProp(gObjects, #BBridge), #State)
  470.   DelObjects(getaProp(getaProp(RegObj, #SpecialChild), getaProp(RegObj, #State)))
  471.   if getaProp(VOBJ, #State) = #off then
  472.     set asound to 0
  473.     if getaProp(BOBJ, #State) = #right then
  474.       if getaProp(RegObj, #State) <> #stationary then
  475.         MakeDynamic(#WaterRegulator, #State, #RIGHTOff)
  476.         MakeDynamic(#BBridge, #State, #close)
  477.       end if
  478.     else
  479.       if getaProp(BOBJ, #State) = #left then
  480.         if getaProp(RegObj, #State) <> #stationary then
  481.           MakeDynamic(#WaterRegulator, #State, #LeftOff)
  482.           MakeDynamic(#BBridge, #State, #close)
  483.         end if
  484.       end if
  485.     end if
  486.   else
  487.     if getaProp(VOBJ, #State) = #LOW then
  488.       set asound to "B28FXtrl.aif"
  489.       if getaProp(BOBJ, #State) = #right then
  490.         MakeDynamic(#WaterRegulator, #State, #RightLOW)
  491.         MakeDynamic(#BBridge, #State, #close)
  492.       else
  493.         if getaProp(BOBJ, #State) = #left then
  494.           MakeDynamic(#WaterRegulator, #State, #LeftLOW)
  495.           MakeDynamic(#BBridge, #State, #open)
  496.         end if
  497.       end if
  498.     else
  499.       if getaProp(VOBJ, #State) = #HI then
  500.         set asound to "B28FXgh1.aif"
  501.         if getaProp(BOBJ, #State) = #right then
  502.           MakeDynamic(#WaterRegulator, #State, #RightHi)
  503.           MakeDynamic(#BBridge, #State, #close)
  504.         else
  505.           if getaProp(BOBJ, #State) = #left then
  506.             MakeDynamic(#WaterRegulator, #State, #LeftHi)
  507.             MakeDynamic(#BBridge, #State, #close)
  508.           end if
  509.         end if
  510.       end if
  511.     end if
  512.   end if
  513.   if getaProp(getaProp(gObjects, #BBridge), #State) <> aState then
  514.     if getaProp(getaProp(gObjects, #BBridge), #State) = #close then
  515.       if getaProp(getaProp(gObjects, #BRocket), #solved) = #false then
  516.         setKFGlobals(#B28A)
  517.         set the castNum of sprite 1 to the number of cast "B28A.PCT"
  518.       else
  519.         setKFGlobals(#B28D)
  520.         set the castNum of sprite 1 to the number of cast "B28D.PCT"
  521.       end if
  522.     else
  523.       if getaProp(getaProp(gObjects, #BRocket), #solved) = #false then
  524.         setKFGlobals(#B28B)
  525.         set the castNum of sprite 1 to the number of cast "B28B.PCT"
  526.       else
  527.         setKFGlobals(#B28C)
  528.         set the castNum of sprite 1 to the number of cast "B28C.PCT"
  529.       end if
  530.     end if
  531.   end if
  532.   playWaterSound(asound)
  533.   AddObjects(getaProp(getaProp(RegObj, #SpecialChild), getaProp(RegObj, #State)))
  534.   if getaProp(RegObj, #State) = #LeftLOW then
  535.     set animObj to getaProp(getaProp(gObjects, #BridgSwingClose), #animator)
  536.     repeat while the pCurrentFrame of animObj < 6
  537.       CursorandUpdate()
  538.     end repeat
  539.     DelObjects(getaProp(getaProp(RegObj, #SpecialChild), getaProp(RegObj, #State)))
  540.     MakeDynamic(#WaterRegulator, #State, #StationaryClose)
  541.     MakeDynamic(#BridgStationary, #DisplayState, #close)
  542.     AddObjects(getaProp(getaProp(RegObj, #SpecialChild), getaProp(RegObj, #State)))
  543.   end if
  544.   if getaProp(VOBJ, #State) = #off then
  545.     DelObjects(getaProp(getaProp(RegObj, #SpecialChild), getaProp(RegObj, #State)))
  546.     MakeDynamic(#WaterRegulator, #State, #StationaryOpen)
  547.     MakeDynamic(#BridgStationary, #DisplayState, #open)
  548.   end if
  549. end
  550.  
  551. on ButterAnimComplete
  552.   AddObjects([#ButterAnimFlap])
  553.   DelObjects([#ButterAnim])
  554.   MakeDynamic(#ButterFlySeen, #State, #seen)
  555.   setRcktPINKeyState(#on)
  556.   switchFeedback(#enterWndSpd)
  557. end
  558.  
  559. on calcTransToB11 Test
  560.   global gKeyRef
  561.   if Test = #Debug then
  562.     return [#B11]
  563.   end if
  564.   if getaProp(getaProp(gObjects, #BBallon), #solved) = #true then
  565.     set gKeyRef to #B12B
  566.   else
  567.     if getaProp(getaProp(gObjects, #BBallon), #solved) = #false then
  568.       set gKeyRef to #B12A
  569.     end if
  570.   end if
  571.   return #B11
  572. end
  573.  
  574. on calcTransToB04 Test
  575.   if Test = #Debug then
  576.     return [#B04A, #B04B]
  577.   end if
  578.   if (getaProp(gCurKeyList, #RefName) = #B12A) or (getaProp(gCurKeyList, #RefName) = #B12B) then
  579.     set gKeyRef to #B12
  580.     return #B04
  581.   end if
  582.   if getaProp(getaProp(gObjects, #BBallon), #solved) = #true then
  583.     return #B04B
  584.   else
  585.     if getaProp(getaProp(gObjects, #BBallon), #solved) = #false then
  586.       return #B04A
  587.     end if
  588.   end if
  589. end
  590.  
  591. on calcTransToB07 Test
  592.   if (getaProp(gCurKeyList, #RefName) = #B12A) or (getaProp(gCurKeyList, #RefName) = #B12B) then
  593.     set gKeyRef to #B12
  594.     return #B07
  595.   end if
  596. end
  597.  
  598. on calcTransToB08 Test
  599.   if Test = #Debug then
  600.     return [#B08A, #B08B]
  601.   end if
  602.   if getaProp(getaProp(gObjects, #BBallon), #solved) = #true then
  603.     return #B08B
  604.   else
  605.     if getaProp(getaProp(gObjects, #BBallon), #solved) = #false then
  606.       return #B08A
  607.     end if
  608.   end if
  609. end
  610.  
  611. on calcTransToB12 Test
  612.   if Test = #Debug then
  613.     return [#B12A, #B12B]
  614.   end if
  615.   if getaProp(getaProp(gObjects, #BBallon), #solved) = #true then
  616.     return #B12B
  617.   else
  618.     if getaProp(getaProp(gObjects, #BBallon), #solved) = #false then
  619.       return #B12A
  620.     end if
  621.   end if
  622. end
  623.  
  624. on calcTransToB13 Test
  625.   if Test = #Debug then
  626.     return [#B13A, #B13B]
  627.   end if
  628.   if getaProp(getaProp(gObjects, #BBallon), #solved) = #true then
  629.     return #B13B
  630.   else
  631.     if getaProp(getaProp(gObjects, #BBallon), #solved) = #false then
  632.       return #B13A
  633.     end if
  634.   end if
  635. end
  636.  
  637. on calcTransToB19 Test
  638.   if Test = #Debug then
  639.     return [#B19A, #B19B]
  640.   end if
  641.   if getaProp(getaProp(gObjects, #BBallon), #solved) = #true then
  642.     return #B19B
  643.   else
  644.     if getaProp(getaProp(gObjects, #BBallon), #solved) = #false then
  645.       return #B19A
  646.     end if
  647.   end if
  648. end
  649.  
  650. on calcTransToB28 Test
  651.   if Test = #Debug then
  652.     return [#B28A, #B28B, #B28C, #B28D]
  653.   end if
  654.   if getaProp(getaProp(gObjects, #BRocket), #solved) = #false then
  655.     if getaProp(getaProp(gObjects, #BBridge), #State) = #open then
  656.       return #B28B
  657.     else
  658.       if getaProp(getaProp(gObjects, #BBridge), #State) = #close then
  659.         return #B28A
  660.       end if
  661.     end if
  662.   else
  663.     if getaProp(getaProp(gObjects, #BRocket), #solved) = #true then
  664.       if getaProp(getaProp(gObjects, #BBridge), #State) = #open then
  665.         return #B28C
  666.       else
  667.         if getaProp(getaProp(gObjects, #BBridge), #State) = #close then
  668.           return #B28D
  669.         end if
  670.       end if
  671.     end if
  672.   end if
  673. end
  674.  
  675. on calcTransToB31 Test
  676.   if Test = #Debug then
  677.     return [#B31A, #B31B, #B31C, #B31D]
  678.   end if
  679.   if getaProp(getaProp(gObjects, #BRocket), #solved) = #false then
  680.     if getaProp(getaProp(gObjects, #BBridge), #State) = #open then
  681.       return #B31B
  682.     else
  683.       if getaProp(getaProp(gObjects, #BBridge), #State) = #close then
  684.         return #B31A
  685.       end if
  686.     end if
  687.   else
  688.     if getaProp(getaProp(gObjects, #BRocket), #solved) = #true then
  689.       if getaProp(getaProp(gObjects, #BBridge), #State) = #open then
  690.         return #B31C
  691.       else
  692.         if getaProp(getaProp(gObjects, #BBridge), #State) = #close then
  693.           return #B31D
  694.         end if
  695.       end if
  696.     end if
  697.   end if
  698. end
  699.  
  700. on calcTransToB30 Test
  701.   if Test = #Debug then
  702.     return [#B30]
  703.   end if
  704.   if getaProp(getaProp(gObjects, #BRocket), #solved) = #false then
  705.     return #B30
  706.   else
  707.     if getaProp(getaProp(gObjects, #BRocket), #solved) = #true then
  708.       return #empty
  709.     end if
  710.   end if
  711. end
  712.  
  713. on calcTransToB10 Test
  714.   if Test = #Debug then
  715.     return [#B10A, #B10B]
  716.   end if
  717.   if (getaProp(getaProp(gObjects, #BBridge), #State) = #close) and (getaProp(getaProp(gObjects, #BRocket), #solved) = #false) and (getaProp(getaProp(gObjects, #BBallon), #solved) = #false) then
  718.     return #B10A
  719.   else
  720.     return #B10B
  721.   end if
  722. end
  723.